<template>
  <div class="page-center">
    <el-pagination
      background
      layout="prev, pager, next"
      :total="100"
      :current-page="currentPage"
      @current-change="clickCurrentPage"
    >
    </el-pagination>
  </div>
</template>

<script>
// import bus from '@/bus'
import { tabParams, upDataParam } from '@/store/tabParams'
export default {
  props: {
    currentPage: {
      type: Number,
      default: 1,
    },
  },
  setup(props, { emit }) {
    function clickCurrentPage(value) {
      //更新数据
      upDataParam({
        page: value || 1,
        limit: tabParams.limit,
        tab: tabParams.tab,
      })
      //bus通信
      // bus.emit('currentPage', val)
    }
    return {
      clickCurrentPage,
    }
  },
}
</script>

<style lang="scss" scope>
.page-center {
  display: flex;
  margin: 50px 0;
  justify-content: center;
}
</style>

<style>
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background-color: #63b5e4;
  color: #fff;
}
</style>